package cn.com.pc.content.event;

import cn.com.pc.content.event.Event;
import org.springframework.context.ApplicationEvent;

import java.time.LocalDateTime;
import java.util.Map;

/**
 * 标签事件
 */
public class TagEvent extends ApplicationEvent implements Event {

    private final String name;
    private final LocalDateTime when;
    private final Map<String, Object> params;

    public TagEvent(Object source, String name, Map<String, Object> params) {
        super(source);
        this.name = name;
        this.when = LocalDateTime.now();
        this.params = params;
    }

    @Override
    public String name() {
        return name;
    }

    @Override
    public LocalDateTime when() {
        return when;
    }

    @Override
    public Map<String, Object> params() {
        return params;
    }
}
